package com.woniu.common.api.api.enums;
import lombok.Getter;

@Getter
public enum ResultCode {

    SUCCESS(200, "ok"),
    FAILED(500, "操作失败"),

    ADD_SUCCESS(10000, "新增成功！"),
    ADD_FAIL(10001, "新增失败！"),
    MODIFY_SUCCESS(11000, "修改成功！"),
    MODIFY_FAIL(11001, "修改失败！"),
    REMOVE_SUCCESS(12000, "删除成功！"),
    REMOVE_FAIL(12001, "删除失败！"),
    LOGIN_FAIL(13001, "登录失败！用户名或密码错误！"),
    SESSION_TIMEOUT(13002, "session超时，请重新登录！"),
    ASSIGN_SUCCESS(15000, "分配成功！"),
    ASSIGN_FAIL(15001, "分配失败！"),
    ORDER_SUCCESS(16000, "排序成功！"),
    ORDER_FAIL(16001, "排序失败！"),
    /**
     * 用户错误：20001-29999
     */
    USER_NOT_LOGGED_IN(20001, "用户未登录"),
    USER_LOGIN_ERROR(20002, "账号不存在或密码错误"),
    USER_ACCOUNT_FORBIDDEN(20003, "账号已被禁用"),
    USER_NOT_EXIST(20004, "用户不存在"),
    USER_HAS_EXISTED(20005, "用户已存在"),

    /**
     * 参数错误：30001-39999
     */
    PARAM_IS_INVALID(30001, "参数无效"),
    PARAM_IS_BLANK(30002, "参数为空"),
    PARAM_TYPE_BIND_ERROR(30003, "参数类型错误"),

    /* 系统错误：40001-49999 */
    SYSTEM_INNER_ERROR(40001, "系统繁忙，请稍后重试"),

    /* 数据错误：50001-599999 */
    RESULT_DATA_NONE(50001, "数据未找到"),
    DATA_IS_WRONG(50002, "数据有误"),
    DATA_ALREADY_EXISTED(50003, "数据已存在"),

    /* 接口错误：60001-69999 */
    INTERFACE_INNER_INVOKE_ERROR(60001, "内部系统接口调用异常"),
    INTERFACE_OUTTER_INVOKE_ERROR(60002, "外部系统接口调用异常"),
    INTERFACE_FORBID_VISIT(60003, "该接口禁止访问"),
    INTERFACE_ADDRESS_INVALID(60004, "接口地址无效"),
    INTERFACE_REQUEST_TIMEOUT(60005, "接口请求超时"),
    INTERFACE_EXCEED_LOAD(60006, "接口负载过高"),

    /* 权限错误：70001-79999 */
    PERMISSION_NO_ACCESS(70001, "无访问权限"),
    NO_AUTH(70002, "没有权限访问请求资源，请切换账户后重试！");

    private long code;

    private String message;

    private ResultCode(long code, String messsage) {
        this.code = code;
        this.message = messsage;
    }
}
